package routers

import (
	"github.com/gin-gonic/gin"
	"local_rtsp_play/pkg/setting"
	"local_rtsp_play/routers/rtsp"
)

func InitRouter() *gin.Engine {
	r := gin.New()

	r.Use(gin.Logger())

	r.Use(gin.Recovery())

	gin.SetMode(setting.ServerSetting.RunMode)

	r.GET("/test", func(context *gin.Context) {
		context.JSON(200, gin.H{
			"message": "test222",
		})
	})

	rtsp := r.Group("/rtsp", rtsp.Pull)
	rtsp.Use()
	{
		rtsp.GET("/pull")
	}

	return r
}
